package com.coment.po;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.annotation.Id;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

@Slf4j
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(of = {"anchorInfoId"}, callSuper = false)
public class Game {
    /// 主播信息id
    @Id
    private Integer anchorInfoId;

    /// 类型: 1.pve 2.pvp
    private Integer type;

    /// 黑名单
    public Set<Integer> blackList = new HashSet<>();

    /// 用户入座信息 k:userInfoId v:rolesId
    public Map<Integer, String> userInfoIdSeat = new ConcurrentHashMap<>();

    /// 怪物信息
    public Set<String> monsterSet = new HashSet<>();

    /// 关卡id
    public Integer level;

    /// 开始时间
    protected Long startTime;

    public Game(Integer anchorInfoId) {
        this.anchorInfoId = anchorInfoId;
        this.type = 1;
        this.userInfoIdSeat = new ConcurrentHashMap<>();
        this.monsterSet = new HashSet<>();
        this.blackList = new HashSet<>();
    }

    public Game(Integer type, Integer anchorInfoId) {
        this.anchorInfoId = anchorInfoId;
        this.type = type;
        this.userInfoIdSeat = new ConcurrentHashMap<>();
        this.blackList = new HashSet<>();
        this.monsterSet = null;
    }
}
